#include<stdio.h>
#define MAX 100
float sum_elements(float a[], unsigned length)
{
	int i;
	float result = 0;
	for (i = 0; i <= length - 1; i++)
	{
		result += a[i];
	}
	getchar(); getchar();
	return result;
}
void main()
{
	float a[MAX];
	unsigned number;
	int i,length;
	printf("Please enter the amount of numbers in your array:\n");
	scanf_s("%u", &number);
	if (number <0)
	{
		printf("Wrong!\n");
		return;
	}
	if (number == 0)
	{
		printf("the result is:%f\n", sum_elements(a, number));
		return;
	}
	else
	{
		printf("Please enter the elements:(the tail of array should be end by 'e')\n");
		for (i = 0; i <= number - 1; i++)
		{
			scanf_s("%f\n", &a[i]);
		}
		printf("the result is:%f\n", sum_elements(a, number));
		return;
	}
	getchar();
	getchar();
	getchar();
}